package manager.dao;


import jdk.nashorn.internal.scripts.JD;
import manager.bean.User;
import manager.util.JDBC;
import java.util.List;

public class UserDao {

    public List<User> getUser(String sql,Object... params) {
        List<User> list = JDBC.query(sql,User.class,params);
        return list;
    }
    public int state (String sql,Object... params){
        int res = JDBC.queryNum(sql,params);
        return res;
    }
    public int deleteUser (String sql,Object... params){
        int count = JDBC.delete(sql,params);
        return count;
    }
    public int addUser(String sql,Object... params){
        int count = JDBC.insert(sql,params);
        return count;
    }
    public int editUser(String sql,Object... params){
        int count = JDBC.update(sql,params);
        return count;
    }
    public int countUser(String sql,Object... params){
        int count = JDBC.queryNum(sql,params);
        return count;
    }
}
